//class Rectangle implements Comparable  {
//    private double width;
//    private double height;
//
//    public Rectangle(double width, double height) {
//        setWidth(width);
//        setHeight(height);
//    }
//
//    public Rectangle() {
//        width = 0;
//        height = 0;
//    }
//
//    public double getWidth() {
//        return width;
//    }
//
//    public void setWidth(double width) throws IllegalArgumentException{
//        if (width < 0) {
//            throw new IllegalArgumentException("矩形的宽度必须大于等于0");
//        }
//        this.width = width;
//    }
//
//    public double getHeight() {
//        return height;
//    }
//
//    public void setHeight(double height) {
//        if (height < 0) {
//            throw new IllegalArgumentException("矩形的高度必须大于等于0");
//        }
//        this.height = height;
//
//    }
//
//    public double getArea(){
//        return width * height;
//    }
//    public double getgetPerimeter(){
//        return 2 * (width + height);
//    }
//
//    public int compareTo(Rectangle rectangle) {
//        double area1 = this.getArea();
//        double area2 = rectangle.getArea();
//
//        if (area1 > area2) {
//            return 1;
//        } else if (area1 < area2) {
//            return -1;
//        } else {
//            return 0;
//        }
//    }
//    @Override
//    public String toString() {
//        return "Rectangle(width:" + String.format("%.1f", width) + ",height:" + String.format("%.1f", height) + ")";
//    }
//
//    @Override
//    public int compareTo(Object o) {
//        return 0;
//    }
//}

abstract class Express{
    int weight;

    public Express(int weight) {
        this.weight = weight;
    }

    int getWeight() {
        return this.weight;
    }

    int getTotal() {
        return 0;
    }
}
class SLExpress extends Express {

    public SLExpress(int weight) {
        super(weight);
    }

    int getWeight() {
        return weight;
    }

    @Override
    int getTotal() {
        if (weight == 1){
            return 12;
        }else {
            return 12 + (weight - 1)*2;
        }
    }
}
class DDExpress extends Express{
    public DDExpress(int weight) {
        super(weight);
    }

    int getTotal() {
        if (weight == 1){
            return 5;
        }else {
            return 5 + (weight - 1)*1;
        }
    }
}
class CaicaiStation{
    int calculate(Express[] ex){
        int all = 0;
        for (Express x : ex) {
            all += x.getTotal();
        }
        return all;
    }
}